package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;

public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html;charset=utf-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\r\n");
      out.write("<html>\r\n");
      out.write("  <head>\r\n");
      out.write("  \t<title>文件上传</title>\r\n");
      out.write("\t<script type=\"text/javascript\" src=\"");
      out.print(request.getContextPath());
      out.write("/js/jquery/jquery-1.4.2.min.js\" ></script>\r\n");
      out.write("  \t<link href=\"");
      out.print(request.getContextPath());
      out.write("/js/uploadify3.2/uploadify.css\" type=\"text/css\" rel=\"stylesheet\" />\r\n");
      out.write("\t<script type=\"text/javascript\" src=\"");
      out.print(request.getContextPath());
      out.write("/js/uploadify3.2/jquery.uploadify.min.js\" ></script>\r\n");
      out.write("  \t<script type=\"text/javascript\">\r\n");
      out.write("\t    //上传导入文件\r\n");
      out.write("\t  \tfunction dataImportFun(buttonId, showText,onUploadSuccess){\r\n");
      out.write("\t  \t\t$('#' + buttonId).uploadify({\r\n");
      out.write("\t  \t\t\tlangFile: '");
      out.print(request.getContextPath());
      out.write("/js/uploadify3.2/langFile.js',//语言包的路径，能设置所有的提示文字\r\n");
      out.write("\t  \t\t\tswf: '");
      out.print(request.getContextPath());
      out.write("/js/uploadify3.2/uploadify.swf',//[必须设置]swf的路径\r\n");
      out.write("\t  \t\t\tuploader: '");
      out.print(request.getContextPath());
      out.write("/servlet/upload.do',//[必须设置]上传文件触发的url\r\n");
      out.write("\t  \t\t\tauto:true,//文件选择完成后，是否自动上传\r\n");
      out.write("\t  \t\t\tbuttonText: showText,//上传按钮的文字\r\n");
      out.write("\t  \t\t\theight: 27,//上传按钮的高和宽\r\n");
      out.write("\t  \t\t\twidth: 100,\r\n");
      out.write("\t  \t\t\tbuttonCursor: 'pointer',//上传鼠标hover后Cursor的形状\r\n");
      out.write("\t  \t\t\tcancelImage: '");
      out.print(request.getContextPath());
      out.write("/js/uploadify3.2/uploadify-cancel.png',//[必须设置]取消图片的路径\r\n");
      out.write("\t  \t\t\tdebug: true,//debug模式开/关，打开后会显示debug时的信息\r\n");
      out.write("\t  \t\t\tfileSizeLimit : 0,//文件的极限大小，以字节为单位，0为不限制。1MB:1*1024*1024\r\n");
      out.write("\t  \t\t\tfileTypeExts: '*.xls;*.xlsx',//允许上传的文件类型，限制弹出文件选择框里能选择的文件\r\n");
      out.write("\t  \t\t\tmethod: 'post',//和后台交互的方式：post/get\r\n");
      out.write("\t  \t\t\tmulti: true,//是否能选择多个文件\r\n");
      out.write("\t  \t\t\tuploadLimit:10,//能同时上传的文件数目\r\n");
      out.write("\t  \t\t\tprogressData : 'all', // 'percentage''speed''all'//队列中显示文件上传进度的方式：all-上传速度+百分比，percentage-百分比，speed-上传速度\r\n");
      out.write("\t  \t\t\tremoveCompleted : true,//上传成功后的文件，是否在队列中自动删除\r\n");
      out.write("\t  \t\t\tremoveTimeout: 1,\r\n");
      out.write("\t  \t\t\tfileTypeDesc: '文件',//允许上传的文件类型的描述，在弹出的文件选择框里会显示\r\n");
      out.write("\t  \t\t\tpostData: {},//和后台交互时，附加的参数\r\n");
      out.write("\t  \t\t\tonUploadSuccess :onUploadSuccess,\r\n");
      out.write("\t  \t\t\tonUploadError: function(file,errorCode,errorMsg,errorString) {//上传文件出错是触发（每个出错文件触发一次）\r\n");
      out.write("\t  \t\t          alert( '上传文件发生错误： ' + errorString \r\n");
      out.write("\t  \t\t\t\t           + '\\n错误代码： ' + errorCode\r\n");
      out.write("\t  \t\t\t\t           + ' ； 错误描述： ' + errorMsg\r\n");
      out.write("\t  \t\t\t\t           + '\\nid： ' + file.id\r\n");
      out.write("\t  \t\t\t\t           + ' ； 索引： ' + file.index\r\n");
      out.write("\t  \t\t\t\t           + ' ； 文件名： ' + file.name\r\n");
      out.write("\t  \t\t\t\t           + ' ； 文件大小： ' + file.size\r\n");
      out.write("\t  \t\t\t\t           + ' ； 类型： ' + file.type\r\n");
      out.write("\t  \t\t\t\t           + ' ； 创建日期： ' + file.creationdate\r\n");
      out.write("\t  \t\t\t\t           + ' ； 修改日期： ' + file.modificationdate\r\n");
      out.write("\t  \t\t\t\t           + ' ； 文件状态： ' + file.filestatus);\r\n");
      out.write("\t  \t\t\t}\r\n");
      out.write("\t  \t\t});\r\n");
      out.write("\t  \t}\r\n");
      out.write("\r\n");
      out.write("\t  \t$(function(){\r\n");
      out.write("\t  \t\tdataImportFun(\"importRequirement\",\"导入需求点\",function (file,data,response) {//上传完成时触发（每个文件触发一次）\r\n");
      out.write("\t  \t    \tdata = eval(\"(\" + data + \")\");\r\n");
      out.write("\t  \t    \talert(data.datas);\r\n");
      out.write("\t  \t    \tajaxPost(\"/manager/requirement/list.html?tradeId=requirementImport&fileName=\" + data.datas,{pro_id:'");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${param.pro_id}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
      out.write("',version_id:'");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${param.version_id}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
      out.write("'},function(data){\r\n");
      out.write("\t  \t\t\t\tdata = eval(\"(\" + data + \")\");\r\n");
      out.write("\t  \t\t\t\talert(data.errorInfo);\r\n");
      out.write("\t  \t\t    \tif(data.errorFlag == \"success\"){\r\n");
      out.write("\t  \t\t    \t\trefreshList();\r\n");
      out.write("\t  \t\t\t\t}\t\t\r\n");
      out.write("\t  \t    \t})\r\n");
      out.write("\t  \t\t})\t\r\n");
      out.write("\r\n");
      out.write("\t\t })\r\n");
      out.write("  \t</script>\r\n");
      out.write("  </head>\r\n");
      out.write("  \r\n");
      out.write("  <body>\r\n");
      out.write("  \t<input id=\"importRequirement\"/>\r\n");
      out.write("  </body>\r\n");
      out.write("</html>\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
        else log(t.getMessage(), t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
